package me.work.pay.jsyl.mvp.model.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;
import java.util.List;

public class DeviceEntity implements Parcelable {
    /**
     * shortKeyName :
     * printStatus : 0
     * printStatusStr : 未开启
     * ylb_brand : all
     * k : 0
     * ylb_brandStr :
     * userarr : [{"chargeXmid":"14bc000423974b669e164d40cb2406f0","chargeName":"朱永川","status":2},{"chargeXmid":"84d490eed039403386670fced8122766","chargeName":"王磊","status":2}]
     * deviceId : 0
     * lock_cashier : 2
     * printNumber : 1
     * printRefund : 0
     * wsyDeviceId : 532542
     * printId :
     * wsy_key : 55409703001
     * shortKey : T1O15c
     * printBrand : pc
     * nickname :
     * audiohornId :
     * register_brandStr : 微收银
     * time : 2019-08-09
     * shopId : 811d5f0cedf18e5ae309dcf032e876bf
     * register_brand : wsy
     * device :
     */

    public String shortKeyName = "";
    public int printStatus;
    public String printStatusStr = "";
    public String ylb_brand = "";
    public int k;
    public String ylb_brandStr = "";
    public int deviceId;
    public String lock_cashier = "";
    public int printNumber;
    public int printRefund;
    public String wsyDeviceId = "";
    public String printId = "";
    public String wsyDeviceKey = "";
    public String shortKey = "";
    public String userName = "";
    @SerializedName(value = "openId", alternate = {"openid"})
    public String openId;
    public String printBrand = "";
    public String nickname = "";
    public String audiohornId = "";
    public String register_brandStr = "";
    public String time = "";
    public String shopId = "";
    public String register_brand = "";
    public String device = "";
    public List<UserBean> userarr = new ArrayList<>();


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.shortKeyName);
        dest.writeInt(this.printStatus);
        dest.writeString(this.printStatusStr);
        dest.writeString(this.ylb_brand);
        dest.writeInt(this.k);
        dest.writeString(this.ylb_brandStr);
        dest.writeInt(this.deviceId);
        dest.writeString(this.lock_cashier);
        dest.writeInt(this.printNumber);
        dest.writeInt(this.printRefund);
        dest.writeString(this.wsyDeviceId);
        dest.writeString(this.printId);
        dest.writeString(this.wsyDeviceKey);
        dest.writeString(this.shortKey);
        dest.writeString(this.userName);
        dest.writeString(this.openId);
        dest.writeString(this.printBrand);
        dest.writeString(this.nickname);
        dest.writeString(this.audiohornId);
        dest.writeString(this.register_brandStr);
        dest.writeString(this.time);
        dest.writeString(this.shopId);
        dest.writeString(this.register_brand);
        dest.writeString(this.device);
        dest.writeTypedList(this.userarr);
    }

    public DeviceEntity() {
    }

    protected DeviceEntity(Parcel in) {
        this.shortKeyName = in.readString();
        this.printStatus = in.readInt();
        this.printStatusStr = in.readString();
        this.ylb_brand = in.readString();
        this.k = in.readInt();
        this.ylb_brandStr = in.readString();
        this.deviceId = in.readInt();
        this.lock_cashier = in.readString();
        this.printNumber = in.readInt();
        this.printRefund = in.readInt();
        this.wsyDeviceId = in.readString();
        this.printId = in.readString();
        this.wsyDeviceKey = in.readString();
        this.shortKey = in.readString();
        this.userName = in.readString();
        this.openId = in.readString();
        this.printBrand = in.readString();
        this.nickname = in.readString();
        this.audiohornId = in.readString();
        this.register_brandStr = in.readString();
        this.time = in.readString();
        this.shopId = in.readString();
        this.register_brand = in.readString();
        this.device = in.readString();
        this.userarr = in.createTypedArrayList(UserBean.CREATOR);
    }

    public static final Parcelable.Creator<DeviceEntity> CREATOR = new Parcelable.Creator<DeviceEntity>() {
        @Override
        public DeviceEntity createFromParcel(Parcel source) {
            return new DeviceEntity(source);
        }

        @Override
        public DeviceEntity[] newArray(int size) {
            return new DeviceEntity[size];
        }
    };
}
